package com.ychen.oms.server;

import org.apache.catalina.LifecycleException;
import org.apache.catalina.startup.Tomcat;

/**
 * @author chenyuliao
 * @version 1.0
 * @description
 * @date 2020/12/13 11:54
 */
public class TomcatServer {
    public static void run() {
        Tomcat tomcat = new Tomcat();
        try {
            tomcat.setPort(8088);
            tomcat.addWebapp("/", "E:\\data\\webapps\\");
//            tomcat.addWebapp("/", "E:\\workspace\\oschina\\");
            tomcat.start();
            tomcat.getServer().await();
        } catch (LifecycleException e) {
            e.printStackTrace();
        }
    }
}
